<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="kau.vo.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<%
	Writing writing = (Writing) request.getAttribute("writing");
%>
<script type="text/javascript">
	function modifyWriting() {
		
			
			var title=document.getElementById("title").value;
			var contents=document.getElementById("contents").value;
			
			if(title=='' ){
				alert("제목을 입력하세요");
				return;
			}
			
			if(contents=='' ){
				alert("내용을 입력하세요");
				return;
			}
			
	
		
		modifyform.submit();
	}
</script>
<style type="text/css">
body {
	font-family: 맑은 고딕;
	font-size: 12px
}
</style>
</head>
<body>


	<div style="margin-top: 40px"></div>
   <form action="/nems/updateWriting.writing?wNumber=<%=writing.getwNumber()%>&bNumber=${requestScope.bNumber}&courseId=${requestScope.courseId}" method="post" name="modifyform">
    
	<table id="view_css" width="700" cellspacing="0"
		style="border: 1px solid #d6d6d6">
		<tr height="30">
			<td width="25%"
				style="border-bottom: 1px solid #d6d6d6; font-weight: bold"
				align="center" bgcolor="#e6efec">제목</td>
			<td align="left"
				style="border-bottom: 1px solid #d6d6d6; border-left: 1px solid #d6d6d6">
				<input id="title" name="title" size="62" type="text" style="border:none;border-right:0px; border-top:0px; boder-left:0px; boder-bottom:0px;" value="${requestScope.writing.title}"/>
            </td>
		</tr>
		<tr height="30">
			<td width="25%"
				style="border-bottom: 1px solid #d6d6d6; font-weight: bold"
				align="center" bgcolor="#e6efec">작성자</td>
			<td align="left" valign="middle"
				style="border-bottom: 1px solid #d6d6d6; border-left: 1px solid #d6d6d6">
				${sessionScope.custName}</td>

		</tr>
		<tr height="30">
			<td width="25%"
				style="border-bottom: 1px solid #d6d6d6; font-weight: bold"
				align="center" bgcolor="#e6efec">파일첨부</td>
			<td align="left" valign="middle"
				style="border-bottom: 1px solid #d6d6d6; border-left: 1px solid #d6d6d6">
				<input size="62" name="uploadFile" type="file"/>
			</td>
		</tr>
		<tr height="300px">
			<td colspan="2" align="center" >
            	<textarea
					id="contents"	name="contents"  rows="20" style="border:none;border-right:0px; border-top:0px; boder-left:0px; boder-bottom:0px; width: 98%;overflow:hidden">${requestScope.writing.content}</textarea>
           </td>
		</tr>
	</table>
    <br />
    <table width="700" cellspacing="0">
    <tr align="center" valign="middle">
				<td ><a href="javascript:modifyWriting()"><img alt="수정" src="/nems/writing/img/modifyBt.gif" border="0"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<a href="javascript:history.go(-1)"><img alt="뒤로" src="/nems/writing/img/cancelBt.gif"  width="47" height="22"  border="0"></a></td>
			</tr>

    
    </table>
   
    </form>
	
	<br>

</body>
</html>